package com.apesource.bookBuy.mapper;

import com.apesource.bookBuy.bean.PayBook;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @version 1.0
 * @auther:暮雪
 * @date:2025/9/5
 */
public interface PayBookMapper {
    @Insert("insert into paybook(bid,uid,tradeno,subject,total,body,paytime) values( #{bid},#{uid},#{tradeno},#{subject},#{total},#{body},now())")
    int addPayBook(PayBook payBook);

    @Select("select * from paybook where uid=#{uid}")
    List<PayBook> getPayBooksByUid(int uid);

    @Select("select * from paybook where uid=#{param1} and body like concat('%', #{param2}, '%')")
    List<PayBook> getPayBooksByUidAndBookName(int uid, String bookName);
}
